<template>
  <tr>
    <td><input type="checkbox" v-model="obj.checked"></td>
    <td>{{ obj.name }}</td>
    <td>{{ obj.price }}</td>
    <td><button @click="obj.num--" :disabled="obj.num === 0">-</button> {{ obj.num }} <button @click="obj.num++">+</button></td>
    <td>{{ obj.price * obj.num }}</td>
    <td><button @click="delFn(index)">删除</button></td>
  </tr>
</template>
 
<script>
export default {
  props: ['obj', 'index'],
  methods: {
    delFn(index){
      this.$emit('delFn', index)
    }
  },
};
</script>

<style scoped>
     
</style>